<template>
  <div>
    <van-field v-model="content" :label="label" :placeholder="placeholder" :type="type"/>
  </div>
</template>

<script>
export default {
    data(){
        return{
            content:""
        }

    },
    props:['label','placeholder','rules','type'],
    watch:{
        content(value){
          let reg = new RegExp(this.rules);
          if(reg.test(value) || this.rules == '') return this.$emit("setContent",value)
        }
    }
};
</script>

<style></style>
